package HomeWork.HomeWork10.Worker;

/***/
public class Person {
    private int id;
    private String name;
    private double salary;

    static int count = 0;

    public Person() {
        this.id = ++count;
    }

    public Person(String name, double salary) {
        this.id = ++count;
        this.name = name;
        this.salary = salary;

    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public void show() {
        System.out.print("姓名:" + name + " 工号:" + id + " 薪水:" + salary);
    }

}
